package cn.mickey.exchange.domain.model;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * IeIdleItemModel
 */
@Accessors(chain = true)
@TableName("ie_idle_item")
@Data
public class IdleItemModel implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 闲置物品主键id
     */
    @TableId
    private Long  idleId;

    /**
     * 闲置物名称
     */
    private String idleName;

    /**
     * 闲置详情
     */
    private String idleDetails;

    /**
     * 图集
     */
    private String pictureList;

    /**
     * 价格
     */
    private String idlePrice;

    /**
     * 发货地区
     */
    private String idlePlace;

    /**
     * 分类标签
     */
    private String idleLabel;

    /**
     * 发布时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @TableField(value = "release_time",fill = FieldFill.INSERT)
    private LocalDateTime releaseTime;

    /**
     * 状态（发布1、下架2、删除0）
     */
    private int idleStatus;

    /**
     * 用户主键id
     */
    private Long userId;

    /**
     * 关联发布当前闲置物品的用户
     */
    @TableField(exist = false)
    private UserModel user;

    /**
     * 逻辑删除
     */
    private Boolean isDeleted;

}